package com.ruoyi.production.service.impl.carton;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.carton.CartonApplyTemporary;
import com.ruoyi.production.mapper.carton.CartonApplyTemporaryMapper;
import com.ruoyi.production.service.carton.ICartonApplyTemporaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 纸箱临时申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-11
 */
@Service
public class CartonApplyTemporaryServiceImpl implements ICartonApplyTemporaryService
{
    @Autowired
    private CartonApplyTemporaryMapper cartonApplyTemporaryMapper;

    /**
     * 查询纸箱临时申请
     *
     * @param cartonApplyTemporaryId 纸箱临时申请ID
     * @return 纸箱临时申请
     */
    @Override
    public CartonApplyTemporary selectCartonApplyTemporaryById(Long cartonApplyTemporaryId)
    {
        return cartonApplyTemporaryMapper.selectCartonApplyTemporaryById(cartonApplyTemporaryId);
    }

    /**
     * 查询纸箱临时申请列表
     *
     * @param cartonApplyTemporary 纸箱临时申请
     * @return 纸箱临时申请
     */
    @Override
    public List<CartonApplyTemporary> selectCartonApplyTemporaryList(CartonApplyTemporary cartonApplyTemporary)
    {
        return cartonApplyTemporaryMapper.selectCartonApplyTemporaryList(cartonApplyTemporary);
    }

    /**
     * 新增纸箱临时申请
     *
     * @param cartonApplyTemporary 纸箱临时申请
     * @return 结果
     */
    @Override
    public int insertCartonApplyTemporary(CartonApplyTemporary cartonApplyTemporary)
    {











        cartonApplyTemporary.setCreateTime(DateUtils.getNowDate());



        return cartonApplyTemporaryMapper.insertCartonApplyTemporary(cartonApplyTemporary);
    }

    /**
     * 修改纸箱临时申请
     *
     * @param cartonApplyTemporary 纸箱临时申请
     * @return 结果
     */
    @Override
    public int updateCartonApplyTemporary(CartonApplyTemporary cartonApplyTemporary)
    {
        cartonApplyTemporary.setUpdateTime(DateUtils.getNowDate());
        return cartonApplyTemporaryMapper.updateCartonApplyTemporary(cartonApplyTemporary);
    }

    /**
     * 批量删除纸箱临时申请
     *
     * @param cartonApplyTemporaryIds 需要删除的纸箱临时申请ID
     * @return 结果
     */
    @Override
    public int deleteCartonApplyTemporaryByIds(Long[] cartonApplyTemporaryIds)
    {
        return cartonApplyTemporaryMapper.deleteCartonApplyTemporaryByIds(cartonApplyTemporaryIds);
    }

    /**
     * 删除纸箱临时申请信息
     *
     * @param cartonApplyTemporaryId 纸箱临时申请ID
     * @return 结果
     */
    @Override
    public int deleteCartonApplyTemporaryById(Long cartonApplyTemporaryId)
    {
        return cartonApplyTemporaryMapper.deleteCartonApplyTemporaryById(cartonApplyTemporaryId);
    }
}
